#!/usr/bin/env python
# encoding: utf-8


from django.urls import path, include
from app01 import views
from app01.view import account,home,project,manage,wiki,issues,setting,file
from django.conf import settings
from django.conf.urls.static import static


urlpatterns = [
    path(r'', home.index,name='home'),
	path(r'login/', account.user_login, name='login'),
	path(r'logout/', account.user_logout, name='logout'),
    path('project/<int:pk>/', views.project_detail, name='project_detail'),
    path('project/add/', views.add_project, name='add_project'),
    path('add_user/', views.add_user, name='add_user'),  # 管理员添加用户
    path('admin/', views.admin_user, name='admin_user'),  # 管理员管理用户

    # 项目管理
	path(r'project/list/', project.project_list, name='project_list'),
	path(r'all_wiki/', project.all_wiki, name='all_wiki'),
	path(r'search_wiki/', project.search_wiki, name='search_wiki'),
	# /project/star/my/1
	# /project/star/join/1
	path('project/star/<str:project_type>/<int:project_id>)/', project.project_star, name='project_star'),
    
	path('project/unstar/<str:project_type>/<int:project_id>)/', project.project_unstar, name='project_unstar'),
    
	path('manage/<int:project_id>/',include([
        path('dashboard/', manage.dashboard, name='dashboard'),
        path('get_users/',manage.get_users,name='get_users'),
        path('get_groups/',manage.get_groups,name='get_groups'),
        path('invite_users/',manage.invite_users,name='invite_users'),
        path('add_station/',manage.add_station,name='add_station'),
        path('add_product/',manage.add_product,name='add_product'),
        path('add_personel/',manage.add_personel,name='add_personel'),
        path('wiki_list/',manage.wiki_list,name='wiki_list'),
        path('issue/', issues.issue, name='issue'),
        path('statistics/', manage.statistics, name='statistics'),
        # 文件管理
        path('file/', file.file, name='file'),
        path('file/delete/', file.file_delete, name='file_delete'),
        path('file/post/', file.file_post, name='file_post'),
        path('file/post/', file.file_post, name='file_post'),
        path('file/download/<int:file_id>/', file.file_download, name='file_download'),
        # wiki管理
        path('wiki/', wiki.wiki, name='wiki'),
        path('wiki/add/', wiki.wiki_add, name='wiki_add'),
        path('wiki/catalog/', wiki.wiki_catalog, name='wiki_catalog'),
        path('wiki/delete/<str:wiki_id>/', wiki.wiki_delete, name='wiki_delete'),
        path('wiki/edit/<str:wiki_id>/', wiki.wiki_edit, name='wiki_edit'),
        path('wiki/upload_img/', wiki.wiki_upload_img, name='wiki_upload_img'),
        path('wiki/fpy/', wiki.fpy, name='wiki_fpy'),
        path('wiki/yield_rate/', wiki.yield_rate, name='wiki_yield_rate'),
        path('wiki/output/', wiki.output, name='wiki_output'),
        # 设置管理
        path('setting/', setting.setting, name='setting'),
        path('setting/delete', setting.setting_delete, name='setting_delete'),

	])),

   
]
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
